<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="include::head"></head>
<body>
<div class="layui-anim layui-anim-scale layui-fluid">
    <div class="layui-row layui-col-space15 table-search">
        <div class="layui-col-md12">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label"><i class="jelly-identification">*</i>原密码</label>
                    <div class="layui-input-inline">
                        <input type="password" name="password" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><i class="jelly-identification">*</i>新密码</label>
                    <div class="layui-input-inline">
                        <input type="password" name="newPassword" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><i class="jelly-identification">*</i>确认新密码</label>
                    <div class="layui-input-inline">
                        <input type="password" name="newPasswords" autocomplete="off" lay-verify="required" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="demo1">确认修改</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>

<div th:include="include::onload"></div>
<script  th:inline="javascript">
    layui.use(['element','form'], function(){
        var form = layui.form;
        //监听提交
        form.on('submit(demo1)', function(data){
            if(data.field.newPassword == data.field.newPasswords){
                $.achieve.post("/share/user-infor/password",data.field,"","");
            }else{
                Layer.showFailMsg("新密码不一致");
            }
            return false;
        });
    });
</script>
</body>
</html>